package com.jk.vehicle.mini.entity;

import com.jk.vehicle.core.entity.BaseEntity;
import java.util.Date;
import javax.persistence.*;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Table(name = "user_bicycle_link")
@Data
public class UserBicycleLink extends BaseEntity {
    /**
     * 车辆id
     */
    @Column(name = "bicycle_id")
    @ApiModelProperty("车辆id")
	private Long bicycleId;

    /**
     * 车辆型号id
     */
    @Column(name = "prod_id")
    @ApiModelProperty("车辆型号id")
	private Long prodId;

    /**
     * 厂家id
     */
    @Column(name = "corp_id")
    @ApiModelProperty("厂家id")
	private Long corpId;

    /**
     * 人员id
     */
    @Column(name = "user_id")
    @ApiModelProperty("人员id")
	private Long userId;

    /**
     * 人员类型 0 管理员 1 被分享人员
     */
    @Column(name = "user_type")
    @ApiModelProperty("人员类型 0 管理员 1 被分享人员")
	private Byte userType;

    /**
     * 分享限期
     */
    @Column(name = "share_limit_date")
    @ApiModelProperty("分享限期")
	private Date shareLimitDate;

    /**
     * 车辆分享人id
     */
    @Column(name = "share_from_user")
    @ApiModelProperty("车辆分享人id")
	private Long shareFromUser;

    /**
     * 车辆购入时间
     */
    @Column(name = "buy_date")
    @ApiModelProperty("车辆购入时间")
	private Date buyDate;

    /**
     * 创建时间
     */
    @Column(name = "create_date")
    @ApiModelProperty("创建时间")
	private Date createDate;

    /**
     * 创建人ID
     */
    @Column(name = "create_user")
    @ApiModelProperty("创建人ID")
	private Long createUser;

    /**
     * 更新时间
     */
    @Column(name = "update_date")
    @ApiModelProperty("更新时间")
	private Date updateDate;

    /**
     * 更新人id
     */
    @Column(name = "update_user")
    @ApiModelProperty("更新人id")
	private Long updateUser;

    public static final class UserBicycleLinkBuilder {
        private Long bicycleId;
        private Long prodId;
        private Long corpId;
        private Long userId;
        private Byte userType;
        private Date shareLimitDate;
        private Long shareFromUser;
        private Date buyDate;
        private Date createDate;
        private Long createUser;
        private Date updateDate;
        private Long updateUser;
        private Long id;
        private Byte delFlag = 0;

        private UserBicycleLinkBuilder() {
        }

        public static UserBicycleLinkBuilder anUserBicycleLink() {
            return new UserBicycleLinkBuilder();
        }

        public UserBicycleLinkBuilder withBicycleId(Long bicycleId) {
            this.bicycleId = bicycleId;
            return this;
        }

        public UserBicycleLinkBuilder withProdId(Long prodId) {
            this.prodId = prodId;
            return this;
        }

        public UserBicycleLinkBuilder withCorpId(Long corpId) {
            this.corpId = corpId;
            return this;
        }

        public UserBicycleLinkBuilder withUserId(Long userId) {
            this.userId = userId;
            return this;
        }

        public UserBicycleLinkBuilder withUserType(Byte userType) {
            this.userType = userType;
            return this;
        }

        public UserBicycleLinkBuilder withShareLimitDate(Date shareLimitDate) {
            this.shareLimitDate = shareLimitDate;
            return this;
        }

        public UserBicycleLinkBuilder withShareFromUser(Long shareFromUser) {
            this.shareFromUser = shareFromUser;
            return this;
        }

        public UserBicycleLinkBuilder withBuyDate(Date buyDate) {
            this.buyDate = buyDate;
            return this;
        }

        public UserBicycleLinkBuilder withCreateDate(Date createDate) {
            this.createDate = createDate;
            return this;
        }

        public UserBicycleLinkBuilder withCreateUser(Long createUser) {
            this.createUser = createUser;
            return this;
        }

        public UserBicycleLinkBuilder withUpdateDate(Date updateDate) {
            this.updateDate = updateDate;
            return this;
        }

        public UserBicycleLinkBuilder withUpdateUser(Long updateUser) {
            this.updateUser = updateUser;
            return this;
        }

        public UserBicycleLinkBuilder withId(Long id) {
            this.id = id;
            return this;
        }

        public UserBicycleLinkBuilder withDelFlag(Byte delFlag) {
            this.delFlag = delFlag;
            return this;
        }

        public UserBicycleLink build() {
            UserBicycleLink userBicycleLink = new UserBicycleLink();
            userBicycleLink.setBicycleId(bicycleId);
            userBicycleLink.setProdId(prodId);
            userBicycleLink.setCorpId(corpId);
            userBicycleLink.setUserId(userId);
            userBicycleLink.setUserType(userType);
            userBicycleLink.setShareLimitDate(shareLimitDate);
            userBicycleLink.setShareFromUser(shareFromUser);
            userBicycleLink.setBuyDate(buyDate);
            userBicycleLink.setCreateDate(createDate);
            userBicycleLink.setCreateUser(createUser);
            userBicycleLink.setUpdateDate(updateDate);
            userBicycleLink.setUpdateUser(updateUser);
            userBicycleLink.setId(id);
            userBicycleLink.setDelFlag(delFlag);
            return userBicycleLink;
        }
    }
}